﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.ProjectWindowCallback;
using UnityEngine;

namespace XFFSM
{
    public class RuntimeFSMControllerCreator : EndNameEditAction
    {
        public override void Action(int instanceId, string pathName, string resourceFile)
        {
            RuntimeFSMController runtimeFSM = ScriptableObject.CreateInstance<RuntimeFSMController>();
            AssetDatabase.CreateAsset(runtimeFSM,pathName);
            Selection.activeObject = runtimeFSM;

            FSMStateNodeFactory.CreateStateNode(runtimeFSM, FSMConst.anyState, new Rect(0, 100, FSMConst.StateNodeWith, FSMConst.StateNodeHeight), false);
            FSMStateNodeFactory.CreateStateNode(runtimeFSM, FSMConst.entryState, new Rect(0, -100, FSMConst.StateNodeWith, FSMConst.StateNodeHeight), false);
        }
    }

}

